package com.dq.repository.order;

import com.dq.domain.orders.UserOrder;
import com.dq.domain.sys.user.center.UserAccountStaffUser;
import com.dq.domain.sys.user.user.StaffUser;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;

/**
 * @Author luchangtong
 * @Date 2019/12/3 12:05
 */
@Repository
public interface UserOrderStaffUserRepository extends JpaRepository<UserAccountStaffUser,Long> {
//    List<UserAccountStaffUser> findByUserOrderAndDeletedFalse(UserOrder userOrder);

//    List<UserAccountStaffUser> findByDeletedFalseAndStaffUserAndUserOrderIsSettleFalseAndUserOrderIsOwedFalseAndUserOrderStatus(StaffUser staffUser, UserOrder.UserOrderStatus status);

//    @Query("select COALESCE(sum(userOrder.price),0) from UserAccountStaffUser where staffUser = ?1 and userOrder.status=?2 and createTime >=?3 and createTime<=?4")
//    BigDecimal countStaffUserSalePrice(StaffUser staffUser, UserOrder.UserOrderStatus status, Long beginTime, Long endTime);

//    UserAccountStaffUser findByDeletedFalseAndUserOrderIdAndStaffUserId(Long userOrderId, Long staffUserId);
}
